{extend name="./view/base/admin.html" /}
{block name="body"}
<div class="card">
    <div class="card-header">
        <form class="row">
            <div class="col-lg-auto col-md-auto col-12 mb-3 mb-sm-0 mb-md-0 mb-lg-0 mb-xl-0">
                <div class="input-group">
                    <a href="{:url('add')}" class="btn btn-success w-100">添加管理员</a>
                </div>
            </div>
        </form>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>编号</th>
                        <th>用户名</th>
                        <th>最后登录时间</th>
                        <th>最后登录IP</th>
                        <th>所属用户组</th>
                        <th>状态</th>
                        <th>添加时间</th>
                        <th>更新时间</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    {foreach $list as $v}
                    <tr>
                        <td>{$v.id}</td>
                        <td>{$v.username}</td>
                        <td>{$v.logintime}</td>
                        <td>{$v.loginip}</td>
                        <td>{$v.group.name}</td>
                        <td>{$v.status==1?'启用':'禁用'}</td>
                        <td>{$v.create_time}</td>
                        <td>{$v.update_time}</td>
                        <td>
                            <a href="{:url('edit',['id'=>$v['id']])}" class="btn btn-xs btn-warning">编辑</a>
                            <?php if($v['id']!=1):?>
                            <button class="btn btn-xs btn-danger" @click="del({id:{$v['id']}})">删除</button>
                            <?php endif;?>
                        </td>
                    </tr>
                    {/foreach}
                </tbody>
            </table>
        </div>
        {$list|raw}
    </div>
</div>
{/block}
{block name="script"}
<script>
    new Vue({
        el:'#content'
    })
</script>
{/block}